<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<canvas id="myCanvas" width="600" height="600" style="background: #000000;">
			
		</canvas>
	</body>
</html>
<script>
	var canvas = document.getElementById('myCanvas');
	var ctx = canvas.getContext('2d');
	var img = new Image();
	img.onload = function(){
		img.x = canvas.width/2;
		img.y = canvas.height/2;
		ctx.drawImage(img, img.x, img.y, img.width, img.height);
		img.imgData = ctx.getImageData(img.x, img.y, img.width, img.height);
	}
	
	
</script>